package cn.iocoder.yudao.module.resource.dal.mysql.audiotext;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.resource.controller.admin.audiotext.vo.AudioTextPageReqVO;
import cn.iocoder.yudao.module.resource.dal.dataobject.audiotext.AudioTextDO;
import cn.iocoder.yudao.module.resource.dal.mysql.audiotext.model.QueryAudioTextParam;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 文本编辑 Mapper
 *
 * @author wgs
 */
@Mapper
public interface AudioTextMapper extends BaseMapperX<AudioTextDO> {

    default PageResult<AudioTextDO> selectPage(AudioTextPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AudioTextDO>()
                .eqIfPresent(AudioTextDO::getId, reqVO.getId())
                .likeIfPresent(AudioTextDO::getContent, reqVO.getContent())
                .orderByDesc(AudioTextDO::getId));
    }

    List<AudioTextDO> selectAudioTextByPage(QueryAudioTextParam param);

    int selectAudioTextCountByPage(QueryAudioTextParam param);

}